import {GameFrameworkEventArgs} from "../Base/GameFrameworkEventArgs";
import {ReferencePool} from "../Base/ReferencePool/ReferencePool";

export class WebRequestAgentHelperCompleteEventArgs extends GameFrameworkEventArgs{

    public static Create(webResponseBytes:number[]):WebRequestAgentHelperCompleteEventArgs{
        let webRequestAgentHelperCompleteEventArgs:WebRequestAgentHelperCompleteEventArgs = ReferencePool.Acquire(WebRequestAgentHelperCompleteEventArgs);
        webRequestAgentHelperCompleteEventArgs._webResponseBytes = webResponseBytes;

        return webRequestAgentHelperCompleteEventArgs;


    }

    private _webResponseBytes:number[];

    public constructor() {
        super();
        this._webResponseBytes = null;
    }

    /// <summary>
    /// 获取 Web 响应的数据流。
    /// </summary>
    /// <returns>Web 响应的数据流。</returns>
    public GetWebResponseBytes():number[]
    {
        return this._webResponseBytes;
    }


    Clear(): void {
        this._webResponseBytes = null;
    }

}